<include file="common/hearder"/>

            <div class="page-header">
                <div class="pull-left">
                    <h4><span class="glyphicon glyphicon-tag"></span>奖惩制度\Reward and punishment system</h4>
                </div>
            </div>
            <div class="pull-right">
                <form action="{:U('index')}" method="post">
                    <input type="text" name="tj" placeholder="输入’类型‘查询">
                    <button type="submit" class="btn btn-mystyle btn-sm"><span class="glyphicon glyphicon-search"></span>搜索</button>
                </form>
            </div>
            <div class="manage-left">
                <a href="{:U('add')}" class="btn btn-info glyphicon glyphicon-plus-sign">添加</a>
                <a onclick="confirm('确定删除数据？删除后可在回收站找回...')?$('#form_all').submit():'false';" class="btn btn-warning glyphicon glyphicon-minus-sign">批量删除</a>
                <a href="{:U('Recycle_bin')}" class="btn btn-danger glyphicon glyphicon glyphicon-trash">回收站</a>
            </div>
            <div class="clearfix"></div>
            <div class="table-margin">
                <form action="{:U('del_all')}" method="post" id="form_all">
                <table class="table table-bordered table-header">
                    <thead>
                    <tr>
                        <td class="w5"><input class="ch_all" type="checkbox"></td>
                        <td class="w10">制度名称</td>
                        <td class="w10">类型</td>
                        <td class="w20">后果</td>
                        <td class="w10">生效时间</td>
                        <td class="w15">操作</td>
                    </tr>
                    </thead>
                    <tbody>
                    <foreach name="list" item="v">
                    <tr>
                        <td><input name="id[]" value="{$v.sy_id}" type="checkbox" class="ch_id"></td>
                        <td>{$v.sy_name}</td>
                        <td>{$v['sy_type']==1?'奖励':'惩罚'}</td>
                        <td>{$v.sy_sequel}</td>
                        <td>{$v.sy_functiontime}</td>
                        <td>
                            <a href="{:U('upd',array('id'=>$v['sy_id']))}" class="btn btn-warning btn-xs active" role="button"><span class="glyphicon glyphicon-pencil"></span>编辑</a>
                            <a href="{:U('del',array('id'=>$v['sy_id']))}" class="btn btn-danger btn-xs active" role="button" onclick="return confirm('确定删除数据？')"><span class="glyphicon glyphicon-trash"></span>删除</a>
                        </td>
                    </tr>
                    </foreach>
                    </tbody>
                </table>
                </form>
                {$show}
            </div>
        </div>
<script>
    //全选  反选
    $('.ch_all').on('click',function () {
        if($(this).prop('checked')){
            $('.ch_id').each(function () {
                if($(this).prop('checked')){
                    $(this).prop('checked',false);
                }
                else {
                    $(this).prop('checked',true);
                }
            })
        }
        else {
            $('.ch_id').prop('checked',false);
        }
    });
</script>

<include file="common/footer"/>